/**
 * Created by isoft-work 5 on 1/3/2015.
 */
$(document).ready(function(){
   bindEventSearchProduct();
});

function bindEventSearchProduct() {
   ISS.EVENT.bindEvent('#search_input_button', 'click', function () {
      searchNameProduct();
   });

   ISS.EVENT.bindEvent('#search-input', 'keyup', function (e) {
      if(e.keyCode === CONSTANT.KEY_CODE.ENTER) {
         searchNameProduct();
      }
   });
}

function searchNameProduct() {
   var _name = ISS.DOM.getVal('#search-input');
   if(_name) {
      ISS.DOM.setVal('#value_search', _name);
      $('#form_search').submit();
   }
   else {
      alert('Hãy nhập từ khoá !');
   }

}
